package org.zoomdev.zoom.common.caster;

import org.zoomdev.zoom.common.utils.Classes;

import java.lang.reflect.Type;

public class String2AnyProvider implements CasterProvider {
    @Override
    public ValueCaster getCaster(Class<?> srcType, Type toType) {
        if (CharSequence.class.isAssignableFrom(srcType)) {
            if (toType instanceof Class) {
                if (Classes.isSimple((Class<?>) toType)) {
                    return null;
                }
            }

            return new String2Other(toType);

        }
        return null;
    }
}
